/*
** 2027.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Mon Sep 22 14:00:27 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "2027.h" */
#include <stdio.h>

int main()
{
     int instance;
     int a, n;			/* a:brains available, n:brains needed */
     
     scanf("%d", &instance);
     while(instance){
	  scanf("%d%d", &a, &n);
	  if (a >= n) printf("MMM BRAINS\n");
	  else printf("NO BRAINS\n");
	  instance--;
     }

     return 0;
}

